public class DialogPlayWildcardActivate : GenericDialog
{
    public int levelNumber;

    private void OnEnable()
    {
        if (Globals.appState != 0 && Globals.appState != AppState.unknown)
        {
            GenericDialog.FireDialogEnabledEvent();
        }
    }

    private void OnDisable()
    {
        if (Globals.appState != 0 && Globals.appState != AppState.unknown)
        {
        }
    }

    public void OnButtonYes()
    {
        Audio.PlaySoundButton();
        CustomAnalytics.LogUIEvent("Menu", "Free Play - Confirm");
        if (Economy.hasInstance)
        {
            Economy.ConsumeWildcard();
        }
        if (!AdManager1.instance.ShieldAddress)
        {
            CheckTouch.Show(() =>
            {
                UserInterface.GetInstance().CloseModalDialog(false);
                UserInterface.GetInstance().StartLevel(levelNumber, GameMode.NormalWildcard);
            });
        }
        else
        {
            UserInterface.GetInstance().CloseModalDialog(false);
            UserInterface.GetInstance().StartLevel(levelNumber, GameMode.NormalWildcard);
        }
    }
}
